package com.taomu.app.zongchouhuli.moudle.index.adpter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

public class BaseViewAdpter extends FragmentPagerAdapter {

    private List<Fragment> mFragments;

    public BaseViewAdpter(FragmentManager fm) {
        super(fm);

    }

    public void setFragment(List<Fragment> mFragments){
        this.mFragments = mFragments;
        notifyDataSetChanged();
    }

    @Override
    public Fragment getItem(int i) {
        return mFragments.get(i);
    }

    @Override
    public int getCount() {
        return mFragments != null ?mFragments.size():0;
    }
}
